<template>
  <div class="pagination-main" :style="{textAlign:align}">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="page.start"  
      :page-sizes="page.sizes"
      :page-size="page.limit"
      layout="total, sizes, prev, pager, next, jumper"
      :total="page.total"
    ></el-pagination>
  </div>
</template>

<script>
export default {
    name: 'pagination',
    props:{
        page:Object,
        align:{
          type:String,
          default: 'right'
        }
    },
    data(){
        return {
            
        }
    },
    methods:{
        handleSizeChange(v){
            this.page.size = v;
            this.$emit('page-change')
        },
        handleCurrentChange(v){
            this.page.start = v;
            this.$emit('page-change')
        }
    }
}
</script>
<style lang="scss" scoped>

</style>


